import http from '../utills/request'
//获取验证码
export let getCaptureApi = () => http.get('/users/getCaptcha?v=next')
//校验验证码
export let verifyCaptureApi = (captch) => http.get('/users/verifyCaptcha?captcha=' + captch)
//登录接口(普通登录)
export let loginApi = (username, password) => http.post('/users/login', {
    username,
    password
})
//手机验证码登录
export let smsApi = code => http.post('/users/login?type=sms', {
    code
})
//获取短信验证码(传入手机号码)
export let getSmsCode = phoneNumber => http.post('/sms/send', { phoneNumber })

//获取角色列表
export let getRoleMsg = (roleid, token) => http.get('/permission/getrole', {
    roleid,
    token
})

//获取权限菜单
export let getPermission = () => http.get('/permission/getMenuList')

//获取登入日志
export let getLoginLog = () => http.get('/getloginlog')

//获取所用用户
export let getAllUsers = () => http.get('/users/getAllUsers')

//获取学员信息
export let getAllStudentMsg = (page=1, count=10, classes='') => http.get('/students/getstulist', {
    params: {
        page,
        count,
        class: classes
    }
})
//增加学员信息
export let addStudentMsg = (parameters) => http.post('/students/addstu',  parameters )

//删除学员信息
export let delStudentMsg = (sId) => http.get('/students/delstu', {
    params: { sId }
})

//修改 学员信息
export let editStudentMsg = (parameter) => http.post('/students/updatestu',  parameter )

//搜索学员
export let seachStudentMsg = (key='', count=10, page = 1) => http.get('/students/searchstu', {
    params: { key, count, page }
})

//上传头像接口
export let uploadHeadImg = () => http.post('/students/uploadStuAvatar', {
    headimgurl
})

